import { Module } from '@nestjs/common';
import { AppController } from './app.controller';
import { AppService } from './app.service';
import { AuthController } from './auth/auth.controller';
import { AuthModule } from './auth/auth.module';
import { DbModule } from '@libs/db';
import { CommonModule } from '@common/common';
import { MulterModule } from '@nestjs/platform-express';
import { CodeController } from './code/code.controller';
import { CodeModule } from './code/code.module';
import { JwtService } from '@nestjs/jwt';
const MAO = require('multer-aliyun-oss');
@Module({
  imports: [CommonModule,
    MulterModule.registerAsync({
      useFactory(){
         return{
            storage: MAO({
              config: {
                  region: process.env.oss_region,
                  accessKeyId: process.env.oss_accessKeyId,
                  accessKeySecret: process.env.oss_accessKeySecret,
                  bucket: process.env.oss_bucket
              }
            })
         }
      }
      
    }),
    AuthModule,
    CodeModule],
  controllers: [AppController, AuthController, CodeController],
  providers: [AppService],
})
export class AppModule {}
